<button class="layui-btn layui-btn-primary" id="add">{$title}</button>
<script>
  layui.use(['jquery'], function(){
    var $ = layui.jquery;
    $('#add').on('click',function(){
      layer.open({
          title:'{$title}',
          type: 2,
          maxmin: true,
          area: ['{:request()->isMobile()?'100%':'500px'}', '420px'],
          id:'addButton',
          content: '{$url}',
          end: function(){
            location.href = location;
          }
      });
    });
  });
</script>
